<template>
  <div>
    <van-nav-bar title="商品搜索" />
    <div class="top_cate">
      <van-search
        v-model="keywords"
        @search="demo"
        placeholder="请输入搜索关键词"
        input-align="center"
      />
    </div>
  </div>
</template>

<script>
import { search } from "../request/api.js";
export default {
  data() {
    return {
      keywords: "",
    };
  },
  methods: {
    demo() {
      console.log(typeof(this.keywords),888888888);
      search(this.keywords)
        .then((d) => {
          console.log(d);
        })
        .catch((e) => {
          console.log(e);
        });
    },
  },
  mounted() {},
};
</script>

<style scoped>
::v-deep .van-nav-bar__content {
  position: fixed;
  background-color: #ff6041;
  top: 0;
  left: 0;
  width: 100vw;
}
::v-deep .van-nav-bar__title,
::v-deep .van-icon-arrow-left:before {
  color: white;
  font-weight: bold;
}
.top_cate {
  display: flex;
  justify-content: center;
  margin-top: 46px;
  padding-bottom: 20px;
  background-color: #ff6041;
}
.van-search {
  height: 40px;
  margin: 0 20px;
  width: 93vw;
  border-radius: 8px;
}
.van-hairline--bottom::after {
  border-bottom-width: 0px;
}
.van-tree-select__nav {
  text-align: center;
}
.van-sidebar-item--select,
.van-sidebar-item--select:active {
  color: #ff6041;
  font-weight: bold;
}
.van-sidebar-item--select::before {
  background-color: #ff6041;
}
::v-deep .van-sidebar-item--select::before {
  width: 23px;
  border-top-right-radius: 100%;
  border-bottom-right-radius: 100%;
}
::v-deep .van-sidebar-item--select::after {
  width: 23px;
  border-top-right-radius: 100%;
  border-bottom-right-radius: 100%;
  position: absolute;
  top: 50%;
  right: 0;
  width: 4px;
  height: 16px;
  background-color: #ff6041;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  content: "";
}
.van-divider {
  font-weight: bold;
  color: #ff6041;
}
</style>